{% extends 'ClassroomBundle:ClassroomManage:layout.html.twig' %}

{% block title %}{{'学员管理'|trans}} - {{ parent() }}{% endblock %}

{% set side_nav = 'students' %}

{% block main %}
       
<div class="panel panel-default panel-col">
  <div class="panel-heading">{{'学员管理'|trans}}
  
  {% if role|default() == 'auditor'%}
    <a class="btn btn-info btn-sm panel-bar mhs" id="export-students-btn" href="javascript:;" data-url="{{ path('classroom_manage_student_export_csv', {id:classroom.id,role:role}) }}" data-datas-url="{{ path('classroom_manage_student_export_datas', {id:classroom.id,role:role}) }}" data-loading-text="正在导出"><i class="glyphicon glyphicon-export"></i> {{'导出旁听生'|trans}}</a>
  {% elseif role|default() == 'student' %}
    <div class="panel-bar">
      <button class="btn btn-info btn-sm mhs" id="student-add-btn" data-toggle="modal" data-target="#modal" data-url="{{ path('classroom_manage_student_create', {id:classroom.id}) }}"><i class="glyphicon glyphicon-plus"></i> {{'添加学员'|trans}}</button>
      {% if classroom.status == 'published' %}
        <a class="btn btn-info btn-sm mhs" data-toggle="modal" data-target="#modal" data-url="{{ path('importer_index', {type: 'classroom-member',classroomId:classroom.id}) }}"><i class="glyphicon glyphicon-import"></i> {{'批量导入'|trans}}</a>
      {% else %}
        <a class="btn btn-info pull-right btn-sm mhs" disabled data-toggle="tooltip" data-placement="top" title="班级未发布,不可导入学员"><i class="glyphicon glyphicon-import"></i> {{'批量导入'|trans}}</a>
      {% endif %}
      <a class="btn btn-info btn-sm mhs" id="export-students-btn" href="javascript:;" data-url="{{ path('classroom_manage_student_export_csv', {id:classroom.id,role:role}) }}" data-datas-url="{{ path('classroom_manage_student_export_datas', {id:classroom.id,role:role}) }}" data-loading-text="正在导出"><i class="glyphicon glyphicon-export"></i> {{'导出学员'|trans}}</a>
    </div>
   {% endif %}

  </div>
  <div class="panel-body">

    <ul class="nav nav-tabs mbl">
      <li class="{% if submenu == 'student' %}active{% endif %}">
        <a href="{{ path('classroom_manage_students', {id:classroom.id}) }}">{{'正式学员'|trans}}
        </a>
      </li>

      <li class="{% if submenu == 'aduitor' %}active{% endif %}">
        <a href="{{ path('classroom_manage_aduitor', {id:classroom.id}) }}">{{'旁听生'|trans}}
        </a>
      </li>

      <li class="{% if submenu == 'record' %}active{% endif %}">
        <a href="{{ path('classroom_manage_record', {id:classroom.id}) }}">{{ '退出记录'|trans }}
        </a>
      </li>
    </ul>
  {% block maincontent %}{% endblock %}
  </div>
</div>

{% endblock %}